package com.ytjj.qmyx.mall.controller;

import com.ytjj.common.api.CommonResult;
import com.ytjj.qmyx.mall.model.SpecialBanner;
import com.ytjj.qmyx.mall.service.SpecialBannerService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 *
 *首页-banner 模块
 */
@RestController
@RequestMapping("/specialBanner")
public class SpecialBannerController {

    @Resource
    private SpecialBannerService specialBannerService;

    @PostMapping("/list")
    public CommonResult getSpeBannerList(@RequestBody SpecialBanner request) {
        return CommonResult.success(specialBannerService.getSpeBannerList(request));
    }

    /**
     * banner列表查询
     * @return
     */
    @GetMapping("/bannerList")
    public CommonResult bannerList() {
        return CommonResult.success(specialBannerService.bannerList());
    }


    @GetMapping("/getSpeBannerListBySubjectId")
    public CommonResult getSpeBannerListBySubjectId(@RequestParam(required = false) Integer subjectId) {
        return CommonResult.success(specialBannerService.getSpeBannerListBySubjectId(subjectId));
    }
}
